Skip to content

Add challenge invite links with personal codes and auto-follow#4

Merged
prazgaitis merged 5 commits intomainfrom
claude/challenge-invite-links-GNX3B
Feb 9, 2026
Merged

Add challenge invite links with personal codes and auto-follow#4
prazgaitis merged 5 commits intomainfrom
claude/challenge-invite-links-GNX3B

Conversation

@prazgaitis
Copy link
Copy Markdown
Owner

Summary

Adds a personal invite link system for challenges that allows users to share unique codes with friends. When someone joins via an invite link, the system automatically records who invited them and creates mutual follow relationships.

Key Changes

Backend:

  • New challengeInvites table to store personal invite codes per user per challenge
  • getOrCreateInviteCode mutation generates an 8-character alphanumeric code (idempotent)
  • resolveInviteCode query resolves invite codes to challenge and inviter info
  • Updated join mutation to accept inviteCode, resolve the inviter, and auto-create mutual follows
  • New getMyInviteCode query to fetch existing codes

Frontend:

  • New invite accept page at /challenges/[id]/invite/[code] that shows challenge details and join button
  • Handles payment flow if challenge requires payment (stores invite code in sessionStorage for post-payment join)
  • Handles auth redirects for unauthenticated users
  • New InviteCard component pinned above activity feed until challenge starts
  • Copy-to-clipboard and Web Share API integration for sharing links

Features

  • Personal invite codes: Each user gets a unique code per challenge they join
  • Auto-follow: Users who join via invite automatically follow each other (mutual)
  • Payment support: Invite flow integrates with existing payment checkout
  • Smart visibility: Invite card only shows before challenge starts
  • Share options: Native share API with clipboard fallback

Testing

  • pnpm lint
  • pnpm typecheck
  • Test invite code generation and idempotency
  • Test joining via invite link (authenticated and unauthenticated)
  • Test payment flow with invite codes
  • Test mutual follow creation
  • Test invite card visibility (shows before start, hides after)
  • Test copy/share functionality

Notes

  • Invite codes are 8 characters from a 55-character alphabet (no confusing chars like 0/O, 1/l, I)
  • The invite accept page is public (no auth required) to allow unauthenticated users to see what they're joining
  • Unauthenticated users are redirected to sign-up with a redirect URL back to the invite page
  • Invite codes are stored in sessionStorage during payment flow to complete the join after checkout

https://claude.ai/code/session_01KiAJKNHGNMPzfLtKwVCMQ6

Users who join a challenge get a personal invite link they can share.
When someone joins via an invite link, the system records who invited
whom and automatically creates mutual follow relationships between
the inviter and invitee. An invite card is pinned to the top of the
dashboard feed until the challenge starts.

- Add challengeInvites table to schema for per-user invite codes
- Add getOrCreateInviteCode mutation and resolveInviteCode query
- Update join mutation to accept inviteCode, resolve inviter, and
  create mutual follows
- Add /challenges/[id]/invite/[code] accept page
- Add InviteCard component with copy/share functionality
- Pin InviteCard above activity feed for upcoming challenges

https://claude.ai/code/session_01KiAJKNHGNMPzfLtKwVCMQ6
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
march-fitness-2025 Error Error Feb 9, 2026 2:04pm

Request Review

@prazgaitis prazgaitis marked this pull request as ready for review February 9, 2026 14:04
@prazgaitis prazgaitis merged commit 890dad0 into main Feb 9, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants